Skip to content

feat: support deployments, sandboxes, and pools - #11

Merged
loks0n merged 1 commit into
mainfrom
chore/update
Aug 14, 2026
Merged

loks0n merged 1 commit into
mainfrom
chore/update

Conversation

@loks0n

@loks0n loks0n commented Aug 14, 2026

Copy link
Copy Markdown
Member

The orchestrator grew three services the SDK did not cover. This adds a client for each, alongside the existing Jobs.

$jobs        = new Jobs($http);
$deployments = new Deployments($http);
$sandboxes   = new Sandboxes($http);
$pools       = new DeploymentPools($http);

What's new

Deployments — apply() (declarative create-or-update), get, list, delete, revisions, setTraffic, release. Full spec support: hosts, autoscaling, probes, concurrency, replicas, runtime class, and the three timeouts. Traffic splits cover canaries and rollbacks, with release() handing traffic back to auto mode.

Sandboxes — create, get, list, delete, plus read-only pools/pool. Handles both create modes: claiming from a pool (sub-second) or building a pod from an image (per-sandbox cpu, memory, runtimeClass, volumes). Exec and files stay out of the SDK deliberately — they're an HTTP contract served inside the sandbox, at the address in $sandbox->url, not part of this API.

DeploymentPools — list, get, activate, activations, activation, deactivate, including async activation via Prefer: respond-async.

Drift fixed in the existing surface

  • MountArtifact was missing sync / syncIntervalSeconds (workspace delta sync across runs). Appended after $depends rather than inserted, so positional callers don't break.
  • CallbackEvent was missing orchestrator.deployment.response and orchestrator.pool.activation.result.

Structure

The four services share one Transport, extracted from Jobs, so request building, error mapping, and JSON decoding have a single implementation. An internal Model\Data helper does the same for field validation across the thirteen new models, keeping them small at PHPStan level 8.

Field names, list envelopes, and status vocabularies were read off the Go structs in open-runtimes/orchestrator (at 94b53b6) rather than the prose docs, which don't show several of the list shapes.

Testing

  • 20 new tests across the three services; 33 total green, including the existing job tests against the refactored transport.
  • PHPStan level 8, Pint, and Rector all clean.
  • Every README example was executed against the PSR-18 test double to confirm the snippets actually run.

Not included

Async deployment requests (Prefer: respond-async to a deployment's host) are data-plane traffic to the gateway, not the orchestrator API this SDK wraps, so they aren't on a service client here.

🤖 Generated with Claude Code

The orchestrator grew three services the SDK did not cover. Add a client
for each, alongside the existing Jobs:

- Deployments — apply (declarative create-or-update), get, list, delete,
  revisions, and traffic splits for canaries, rollbacks, and release back
  to auto mode.
- Sandboxes — create (claiming from a pool, or building a pod from an
  image), get, list, delete, plus the read-only sandbox pools. Exec and
  files stay out: they are a contract served inside the sandbox, not part
  of this API.
- DeploymentPools — read pools, and activate/read/deactivate the
  activations that claim their warm pods, including async activation via
  Prefer: respond-async.

The four services share one Transport, extracted from Jobs, so request
building, error mapping, and JSON decoding have a single implementation;
a Model\Data helper does the same for field validation across the new
models.

Also close two gaps in the existing surface: MountArtifact was missing
sync/syncIntervalSeconds, and CallbackEvent was missing the deployment
response and pool activation result events.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@loks0n
loks0n merged commit ec2a3db into main Aug 14, 2026
5 checks passed
@greptile-apps

greptile-apps Bot commented Aug 14, 2026

Copy link
Copy Markdown

Greptile Summary

The PR expands the SDK with deployment, sandbox, and deployment-pool clients while extracting the existing Jobs HTTP logic into a shared transport.

  • Adds request APIs and typed response models for deployments, traffic management, sandboxes, pools, and activations.
  • Adds runtime and lifecycle enums plus shared response-validation helpers.
  • Extends mount artifacts and callback events for newer orchestrator capabilities.
  • Adds service tests and usage documentation for the new API surface.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete changed-code failure established.

The existing Jobs transport behavior is preserved, and the new service clients consistently construct encoded routes, serialize optional fields, validate mode-specific inputs, and decode their documented response models without an identified reachable failure.

Important Files Changed

Filename Overview
src/Deployments.php Adds deployment lifecycle, revision, and traffic APIs with structured payload serialization; no concrete defect was established.
src/Sandboxes.php Adds sandbox creation and lifecycle APIs with explicit create-mode validation and encoded resource identifiers.
src/DeploymentPools.php Adds pool reads and activation lifecycle operations, including callback validation and the asynchronous preference header.
src/Transport.php Extracts request construction, JSON decoding, and exception mapping from Jobs without changing its established behavior.
src/Model/Data.php Centralizes strict response-field validation for the new models; no valid response shape was shown to be rejected.
src/Jobs.php Delegates existing HTTP behavior to the shared transport with no material regression identified.
src/Model/Artifact/MountArtifact.php Appends optional synchronization fields and conditionally serializes them without disrupting positional callers.
tests/DeploymentsTest.php Covers deployment payloads, response hydration, revisions, traffic control, and release behavior.
tests/SandboxesTest.php Covers both sandbox creation modes, validation, response hydration, listing, deletion, and pool reads.
tests/DeploymentPoolsTest.php Covers pool lookup, activation payloads, asynchronous headers, callback requirements, listing, lookup, and deactivation.

Reviews (1): Last reviewed commit: "feat: support deployments, sandboxes, an..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant